package com.ygxsk.carhome.imagepick;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Author 姚智胜
 * Version V1.0版本
 * Description:
 * Date: 2017/4/10
 */

public class ImageBean extends ImageShowPickerBean implements Parcelable {


    public ImageBean(String url) {
        this.url = url;
    }

    public ImageBean(int resId) {
        this.resId = resId;
    }

    private String url;
    private int resId;


    @Override
    public String setImageShowPickerUrl() {
        //LogUtils.d("itchen---执行---setImageShowPickerUrl 方法--->url==>" + url);
        return url;
    }

    @Override
    public int setImageShowPickerDelRes() {
        return resId;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.url);
        dest.writeInt(this.resId);
    }

    protected ImageBean(Parcel in) {
        this.url = in.readString();
        this.resId = in.readInt();
    }

    public static final Creator<ImageBean> CREATOR = new Creator<ImageBean>() {
        @Override
        public ImageBean createFromParcel(Parcel source) {
            return new ImageBean(source);
        }

        @Override
        public ImageBean[] newArray(int size) {
            return new ImageBean[size];
        }
    };
}
